Skip to content

fix(otel): Fix X-Ray trace integration and cross-invocation retry spans#508

Merged
ayushiahjolia merged 1 commit into
mainfrom
fix/otel-plugin-xray-integration
Jul 7, 2026
Merged

fix(otel): Fix X-Ray trace integration and cross-invocation retry spans#508
ayushiahjolia merged 1 commit into
mainfrom
fix/otel-plugin-xray-integration

Conversation

@ayushiahjolia

@ayushiahjolia ayushiahjolia commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Issue Link, if available

#507

Description

Fixes OTel plugin X-Ray integration: cross-invocation retry span grouping, trace context extraction, and trace map display to match the JS SDK behavior.

  1. Retry attempts grouped under wrong invocation - When a step failed in invocation 1 and retried in invocation 2, both operation spans had the same deterministic span ID, causing trace viewers to merge them.
  2. Durable spans in separate traceSystem.getenv("_X_AMZN_TRACE_ID") returned stale/null values due to JVM env caching, so the plugin fell back to an ARN-derived trace ID disconnected from Lambda's X-Ray segments.
  3. Spans nested inside Lambda function instead of separate node - Missingservice.name resource and SpanKind.SERVER prevented X-Ray from creating a distinct service node for durable execution spans.

Demo/Screenshots

Screenshot 2026-06-30 at 12 33 02 PM

Checklist

  • I have filled out every section of the PR template
  • I have thoroughly tested this change

Testing

Unit Tests

Have unit tests been written for these changes? Yes

Integration Tests

Have integration tests been written for these changes? N/A

Examples

Has a new example been added for the change? (if applicable) Updated existing ones.

@ayushiahjolia ayushiahjolia force-pushed the fix/otel-plugin-xray-integration branch 3 times, most recently from 9a7cb23 to 5c269c3 Compare June 30, 2026 20:33
@ayushiahjolia ayushiahjolia marked this pull request as ready for review June 30, 2026 20:46
@ayushiahjolia ayushiahjolia requested a review from a team June 30, 2026 20:46
Comment thread examples/template.yaml
Comment thread sdk/src/main/java/software/amazon/lambda/durable/plugin/OperationInfo.java Outdated
Comment thread otel-plugin/src/main/java/software/amazon/lambda/durable/otel/OtelPlugin.java Outdated
Comment thread otel-plugin/src/main/java/software/amazon/lambda/durable/otel/OtelPlugin.java Outdated
@ayushiahjolia ayushiahjolia force-pushed the fix/otel-plugin-xray-integration branch from 5c269c3 to 09cd16b Compare July 6, 2026 21:17
@ayushiahjolia ayushiahjolia force-pushed the fix/otel-plugin-xray-integration branch from 09cd16b to 55c4e3b Compare July 7, 2026 00:49
@ayushiahjolia ayushiahjolia requested a review from SilanHe July 7, 2026 00:49
@ayushiahjolia ayushiahjolia force-pushed the fix/otel-plugin-xray-integration branch from 55c4e3b to 0a261dd Compare July 7, 2026 21:45
@ayushiahjolia ayushiahjolia requested a review from zhongkechen July 7, 2026 21:51
@ayushiahjolia ayushiahjolia enabled auto-merge (squash) July 7, 2026 22:19
@ayushiahjolia ayushiahjolia disabled auto-merge July 7, 2026 22:19
@ayushiahjolia ayushiahjolia merged commit 29cb053 into main Jul 7, 2026
12 checks passed
@ayushiahjolia ayushiahjolia deleted the fix/otel-plugin-xray-integration branch July 7, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants